<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
var isString =
<script>
    var isString = function (obj) {
        return Object.prototype.toString.call(obj) ==='[object String]';
    }
    var isArray = function (obj) {
        return Object.prototype.toString.call(obj)==='[object Array]';
    }
    var isNumber = function (obj) {
        return Object.prototype.toString.call(obj)==='[object Number]';
    }

    var isType = function (type) {
        console.log(type);
        return function (obj) {
            console.log(Object.prototype.toString.call( obj ));
            return Object.prototype.toString.call( obj ) === `[object ${type}]`
        }
    }
    var isstring  = isType('String')
    var isarray = isType('Array');
    console.log(isstring('swsw'));
</script>
</body>
</html>